#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 18 mai. 2011

@author: alinehuf

The Controller class is an intermediary between the UI (UiMainWindow) and
"business".
'''

class Controleur():
    def __init__(self, modele):
        self.modele = modele
  
    def creerNouvellePartie(self, partie) :
        self.modele.nouveauCombat(partie)
    
    def creerPersonnage(self, nom, type, race):
        self.modele.creerPerso(nom, type, race)
    
    def creerEquipe(self, equipe1, equipe2):
        self.modele.creerEquipe(equipe1, equipe2)

    def positionnePersonnage(self, nom, case):
        self.modele.positionneElement(nom, case)
    
    def mousePressEvent(self, case, bouton):
        if bouton == 1 : self.modele.clicCase(case)
        if bouton == 2 : self.modele.utiliseCompetence(case)
    
    def demandeCompetence(self, texte):
        self.modele.demandeCompetence(texte)
    
    def lancePartie(self):
        self.modele.lancePartie()
